#include<bits/stdc++.h>
using namespace std;
#define ll long long
 
int main(){
    int l,e;
    cin>>l>>e;
    if(l>=8){
        cout<<"3"<<endl;
        return 0;
    }
    else if(l>=6&&e==1){
        cout<<"3"<<endl;
        return 0;
    }
    else if(l<3){
        cout<<"Impossible"<<endl;
        return 0;
    }
    else {
        cout<<"6"<<endl;
        return 0;
    }

    return 0;
}